package net.wofly.sale.order.util;

public enum OrderStatus {
    
    草稿(1001,"草稿"),
    订单提交_未支付(1101, "订单提交/未支付"),
    驳回(1104, "驳回"),
    货到付款_未支付(1106, "货到付款/未支付"),
    白条已支付(1107, "白条已支付"),
    订单取消1109(1109, "订单取消"),
    支付定金(1201, "支付定金"),
    预发货(1301, "预发货"),
    订单己支付(1401, "订单己支付"),
    订单取消1409(1409, "订单取消"),
    己发货(1501, "己发货"),
    订单取消1509(1509, "订单取消"),
    己结帐(1601, "己结帐"),
    己对帐(1701, "己对帐"),
    回款中(1702, "回款中"),
    业务经理发放赠品(1705, "业务经理发放赠品"),
    己平帐(1801, "己平帐"),
    老板己审核(1901, "老板己审核"),
    己入帐(2001, "己入帐");
    
    private Integer value;
    private String name;
    
    OrderStatus(Integer value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (OrderStatus forEnum : values()) {
            if (value == forEnum.getValue().intValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        if (value == null) {
            return null;
        }
        for (OrderStatus forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
}
